{include file=member.header.html}

<script type="text/javascript">
$(function(){
    $('#add_time_from').datepicker({dateFormat: 'yy-mm-dd'});
    $('#add_time_to').datepicker({dateFormat: 'yy-mm-dd'});
});
</script>

<div id="page-my-address" class="mb10">
    <div class="page-body my-address pb20">
        <form method="get">
            <input type="hidden" name="app" value="buyer_order" />
            <input type="hidden" name="act" value="index" />
            <dl style="margin-bottom:15px;" class="inclusive-box f66">
                <dd>
                    <label>{$lang.add_time}: </label>
                    <span>
                        <input type="text" class="text1 width2" name="add_time_from" id="add_time_from" value="{$query.add_time_from}" />
                        <input type="text" class="text1 width2" name="add_time_to" id="add_time_to" value="{$query.add_time_to}" />
                    </span>
                </dd>
                <dd>
                    <label>{$lang.order_sn}: </label>
                    <span>
                    	<input type="text" class="text1 width_normal" name="order_sn" value="{$query.order_sn|escape}">
                    </span>
                </dd>
                <dd>
                    <label>{$lang.order_status}: </label>
                    <span>
                        <select name="type">
                            {html_options options=$types selected=$type}
                        </select>
                    </span>
                </dd>
                <dd>
                    <input type="submit" class="btn" value="查询" />
                </dd>
            </dl>
        </form>
    </div>
</div>

<div id="page-buyer-order">
	<div class="buyer-order-body page-body"> 
		<!--{foreach from=$orders item=order}-->
		<div class="order-form mb10">
			<h2 class="clearfix">
				<p class="name"><a href="{url app=store&id=$order.seller_id}" >{$order.seller_name|escape}</a></p>
				<p class="num ml10">{$lang.order_sn}: {$order.order_sn}{if $order.extension eq 'groupbuy'}<span class="color8">[{$lang.groupbuy}]</span>{/if}</p>
			</h2>
			
			<!--{foreach from=$order.order_goods item=goods name=fe_goods}-->
			<div {if !$smarty.foreach.fe_goods.last}style="border-bottom-style:dashed"{/if} class="con clearfix">
				<div class="pic float-left"><a href="{url app=goods&id=$goods.goods_id}" ><img src="{$goods.goods_image}" width="50" height="50"  /></a></div>
				<div class="txt float-left ml5"> 
					<p><a href="{url app=buyer_order&act=view&order_id=$order.order_id}">{$goods.goods_name|escape}</a></p>
					<!--{if $goods.specification}-->
					<span class="attr mt5">{$goods.specification|escape}</span><br />
					<!--{/if}-->
					<span class="order-amount mt5">实付:{$order.order_amount|price}</span><br />
					
					<span class="mt5">共 {$goods.quantity} 件</span><br />
				</div>
			</div>
			<!--{/foreach}-->
			<p class="status">
				<em>
					{$order.status|modifier:order_status}<!--{if $order.evaluation_status}-->&nbsp;{$lang.already_evaluate}<!--{/if}--> 
					<!--{if $order.refund_status eq 'SUCCESS'}-->
					<span class="ml10" style="color:#096;">退款成功</span> 
					<!--{elseif $order.refund_status eq 'CLOSED'}--> 
					<span class="ml10 gray">退款关闭</span> 
					<!--{elseif $order.refund_status}--> 
					<span class="ml10 f60">退款中</span>
					<!--{/if}-->
				</em>
			</p>
			<div class="operate-btn pt10">
				<a class="btn1 mr10" href="{url app=buyer_order&act=evaluate&order_id=$order.order_id}"  id="order{$order.order_id}_evaluate" {if $order.status neq ORDER_FINISHED or $order.evaluation_status neq 0}style="display:none"{/if}>{$lang.evaluate}</a>
				<a class="btn1 mr10" href="{url app=cashier&order_id=$order.order_id}"  id="order{$order.order_id}_action_pay" {if $order.status neq ORDER_PENDING} style="display:none"{/if} >{$lang.pay}</a>
				<a class="btn1 mr10" href="{url app=buyer_order&amp;act=confirm_order&order_id=$order.order_id}" {if $order.status neq ORDER_SHIPPED or $order.payment_code eq 'cod'} style="display:none"{/if}>{$lang.confirm_order}</a>
				<a class="btn1 mr10" href="{url app=buyer_order&amp;act=cancel_order&order_id=$order.order_id}" {if $order.status neq ORDER_PENDING and $order.status neq ORDER_SUBMITTED} style="display:none"{/if}>{$lang.cancel_order}</a>
				<a class="btn1 mr10" href="{url app=buyer_order&act=view&order_id=$order.order_id}" >{$lang.view_order}</a> 
				
				<!--{if $order.refund_status}-->
                <a class="btn1 mr10" href="{url app=refund&act=view&refund_id=$order.refund_id}">退款详情</a>
				<!--{elseif ($order.status==20 || $order.status==30)}-->
				<a class="btn1 mr10" href="{url app=refund&act=add&order_id=$order.order_id}">申请退款</a>
				<!--{/if}-->
								
				<!--{if $enable_express}--> 
				<a class="btn1 mr10" href="{url app=order_express&amp;order_id=$order.order_id}" {if $order.status neq ORDER_SHIPPED && $order.status neq ORDER_FINISHED} style="display:none"{/if}>{$lang.view_delivery_track}</a> 
				<!--{/if}--> 
			</div>
		</div>
		<!--{foreachelse}-->
		<div class="no-record"> <span>{$lang.no_records}</span> </div>
		<!--{/foreach}--> 
	</div>
	<!--{if $orders}--> 
	{include file=page.bottom.html} 
	<!--{/if}--> 
</div>
{include file=footer.html} 